package jn.chen.utils.interfaceController.domain;

import lombok.Data;

import javax.validation.constraints.*;

/**
 * @className: User
 * @author: chenLin
 * @version: 1.0.0
 * @description:
 * @date: 24/1/15 015 14:43
 */
@Data
public class User {

    @NotNull(message = "用户名不能为空")
    private String name;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 12, message = "密码长度必须在6-12位之间")
    private String password;

    @NotBlank(message = "邮箱不能为空")
    private String email;

    @Pattern(regexp = "^1[3|4|5|7|8][0-9]\\d{8}$", message = "手机号码格式不正确")
    private String phone;

    @NotBlank(message = "年龄不能为空")
    @Min(value = 18, message = "未成年人禁止注册")
    @Max(value = 60, message = "年龄过大")
    private Integer age;
}

